<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .nav {
            color: red;
        }

        li {
            color: pink;
        }

        /* 权重0,0,1,1 */
        .nav li {
            color: green;
        }

        /* 权重0,0,1,0*/
        .pink {
            color: pink;
            font-size: 20px;
        }

        /* 要求:把喜第一个li改为粉色加粗 */
        /* 权重0,0,2,0 */
        .nav .pink {
            color: pink;
        }
    </style>
</head>

<body>
    最终显示颜色为粉色,因为继承优先级到子类的时候会降为0,继承的权重为0
    <ul class="nav">
        <li class="pink">喜</li>
        <li>怒</li>
        <li>哀</li>
        <li>乐</li>
    </ul>
</body>

</html>